
/*
import Header from '@/components/Header.vue' ;
import Navigator from '@/components/Navigator.vue' ;
import Main from '@/components/Main.vue' ;
import Footer from '@/components/Footer.vue' ;

import CourseList from '@/components/CourseList.vue' ;
import User from '@/components/User.vue' ;
*/

const Header = () => import( '@/components/Header.vue' ) ;
const Navigator = () => import( '@/components/Navigator.vue' ) ;
const Main = () => import( '@/components/Main.vue' ) ;
const Footer = () => import( '@/components/Footer.vue' ) ;

const CourseList = () => import( '@/components/CourseList.vue' ) ;
const User = () => import( '@/components/User.vue' ) ;

const routes = [
    {
        path: '/' ,
        name: 'root' ,
        components: {
            header: Header ,
            navigator: Navigator,
            main: Main ,
            footer: Footer 
        },
        meta: {
            title: '首页'
        }
    },
    {
        path: '/course/list' ,
        name: 'courseList' ,
        components: {
            header: Header ,
            navigator: Navigator,
            main: CourseList ,
            footer: Footer 
        },
        meta: {
            title: '课程列表'
        }
    },
    {
        path: '/user/:id(\\d+)' ,
        name: 'user' ,
        // 路由独享的守卫
        beforeEnter: (to,from)=>{
            console.log( `Per-Route Guard: 从${from.path}到${to.path}` );
        },
        components: {
            header: Header ,
            navigator: Navigator,
            main: User ,
            footer: Footer 
        },
        props: {
            header: false , 
            navigator: false ,
            main: true ,
            footer: false
        },
        meta: {
            title: '用户信息'
        }
    }
]

export default routes ;